<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="jquery.js" type="text/javascript"></script>
<script>
$(function(){
	$("#signin_button").click(function(){
		$.post("signin.php",{
			username:$("#signin_username").val(),
			passwd:$("#signin_password").val()
			},function(data){
				if(data.trim()=="admin")
				{
					$("#homepage").load("admin.html");
				}
				else if(data.trim()=="student")
				{
					$("#homepage").load("admin.html");
				}
				else
				{
					$("#result").html("Invalid username and password");
				}
			});
	});
});
</script>
</head>
<body>
	<div id="homepage">
		<div>
			Username<input type="text" id="signin_username" name="sigin_username"/>
			Password<input type="password" id="signin_password" name="signin_password"/>
			<label id="result"></label>
			<button id="signin_button">Signin</button>
		</div>
	</div>
</body>
</html>
